package climspace.data;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * Entity implementation class for Entity: WeatherData
 * @Author: dnguyen
 *
 */
@Entity
@NamedQueries( {
	@NamedQuery(name = "getWeatherDataByStationID", query = "SELECT e FROM WeatherData e WHERE e.primary_id = :primary_id ORDER BY e.entry_datetime DESC")
})
@Table(name = "WeatherData")	
public class WeatherData implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 293102900558301132L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	Long id;
	
	@Column(nullable = true)
	String primary_id;
	
	/*@OneToOne(optional=false,cascade=CascadeType.ALL, mappedBy="weatherData",targetEntity=WeatherStation.class)
	private WeatherStation weatherStation;	
	*/
	@Column(nullable = true)
	Date entry_datetime;
	
	// TODO: we have kept the data type as double because of the data ..but it should be long.
	@Column(nullable = true)
	double mnet_id;
	
	@Column(nullable = true)
	double station_latitude;
	
	@Column(nullable = true)
	double station_longitude;
	
	@Column(nullable = true)
	double station_elevation;
	
	@Column(nullable = true)
	double temperature;
	
	@Column(nullable = true)
	double wind_speed;
	
	@Column(nullable = true)
	double wind_direction;
	
	@Column(nullable = true)
	double wind_gust;
	
	@Column(nullable = true)
	double sea_level_pressure;
	
	@Column(nullable = true)
	double altimeter;
	
	@Column(nullable = true)
	double dew_point;
	
	@Column(nullable = true)
	double relative_humidity;
	
	@Column(nullable = true)
	double weather_code;
	
	@Column(nullable = true)
	double precipitation;

	public Date getEntry_datetime() {
		return entry_datetime;
	}

	public void setEntry_datetime(Date entry_datetime) {
		this.entry_datetime = entry_datetime;
	}

	public double getMnet_id() {
		return mnet_id;
	}

	public void setMnet_id(double mnet_id) {
		this.mnet_id = mnet_id;
	}

	public double getStation_latitude() {
		return station_latitude;
	}

	public void setStation_latitude(double station_latitude) {
		this.station_latitude = station_latitude;
	}

	public double getStation_longitude() {
		return station_longitude;
	}

	public void setStation_longitude(double station_longitude) {
		this.station_longitude = station_longitude;
	}

	public double getStation_elevation() {
		return station_elevation;
	}

	public void setStation_elevation(double station_elevation) {
		this.station_elevation = station_elevation;
	}

	public double getTemperature() {
		return temperature;
	}

	public void setTemperature(double temperature) {
		this.temperature = temperature;
	}

	public double getWind_speed() {
		return wind_speed;
	}

	public void setWind_speed(double wind_speed) {
		this.wind_speed = wind_speed;
	}

	public double getWind_direction() {
		return wind_direction;
	}

	public void setWind_direction(double wind_direction) {
		this.wind_direction = wind_direction;
	}

	public double getWind_gust() {
		return wind_gust;
	}

	public void setWind_gust(double wind_gust) {
		this.wind_gust = wind_gust;
	}

	public double getSea_level_pressure() {
		return sea_level_pressure;
	}

	public void setSea_level_pressure(double sea_level_pressure) {
		this.sea_level_pressure = sea_level_pressure;
	}

	public double getAltimeter() {
		return altimeter;
	}

	public void setAltimeter(double altimeter) {
		this.altimeter = altimeter;
	}

	public double getDew_point() {
		return dew_point;
	}

	public void setDew_point(double dew_point) {
		this.dew_point = dew_point;
	}

	public double getRelative_humidity() {
		return relative_humidity;
	}

	public void setRelative_humidity(double relative_humidity) {
		this.relative_humidity = relative_humidity;
	}

	public double getWeather_code() {
		return weather_code;
	}

	public void setWeather_code(double weather_code) {
		this.weather_code = weather_code;
	}

	public double getPrecipitation() {
		return precipitation;
	}

	public void setPrecipitation(double precipitation) {
		this.precipitation = precipitation;
	}

	public String getPrimary_id() {
		return primary_id;
	}

	public void setPrimary_id(String primary_id) {
		this.primary_id = primary_id;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}
